home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls089.ibmaix.Z / tls089.ibmaix / lib / vtcl / tests / optmenu3.tcl < prev    next >
Encoding:
Text File  |  1995-07-20  |  1.1 KB  |  59 lines

  1. # CVS $Id: optmenu3.tcl,v 1.3 1995/02/03 16:55:09 zibi Exp $
  2.  
  3. #
  4. # Test program for dynamic option menus using routines in tools.tcl
  5. #
  6. global mediaMenu densityMenu
  7.  
  8. proc quitCB {cbs} {
  9.         VtClose
  10.         exit 0
  11. }
  12.  
  13.  
  14. proc mediaCB {cbs} {
  15.     global mediaMenu densityMenu
  16.  
  17.     set selection [VxOptionMenuGetSelected $mediaMenu]
  18.  
  19.     if {$selection == "floppy"} {
  20.           VxOptionMenuReplaceOptions $densityMenu [list 1440K 720K 100K] 1440K
  21.     }
  22.  
  23.     if {$selection == "tape"} {
  24.          VxOptionMenuReplaceOptions $densityMenu [list 600MB 1000MB] 600MB
  25.     }
  26.  
  27.     if {$selection == "hardDisk"} {
  28.        VxOptionMenuReplaceOptions $densityMenu [list 10MB 20MB 30MB 40MB] 10MB
  29.     }
  30. }
  31.  
  32.  
  33.  
  34. #
  35. # Start Program
  36. #
  37.  
  38. set app [VtOpen optionMenu]
  39.  
  40. set fn [VtFormDialog $app.form -title "Option Menus"]
  41.  
  42. set mediaMenu \
  43. [VxOptionMenu $fn.mediaMenu Media: {floppy tape hardDisk} mediaCB tape]
  44.  
  45. set densityMenu \
  46. [VxOptionMenu $fn.densityMenu Density: {} "" ""]
  47.  
  48. mediaCB {}
  49.  
  50. set quit [VtPushButton $fn.quit -callback quitCB \
  51.                                 -leftSide FORM \
  52.                 -rightSide FORM \
  53.                 -bottomSide FORM]
  54.  
  55. VtShow $fn
  56. VtMainLoop
  57.  
  58.  
  59.